<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>订货管理</title>
		<link rel="stylesheet" href="/public/oem/css/css.css" />
		<script type="text/javascript" src="/public/static/js/jquery.min.js"></script>
		<link rel="stylesheet" href="/public/static/layui/css/layui.css">
		<script src="/public/static/layui/layui.js"></script>
	</head>

	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<div class="layui-tab-content">
			<div class="layui-tab-item layui-show">
				<form class="layui-form" id='my_form' method="post">
					<div class="layui-form-item">
						<label class="layui-form-label">订货人</label>
						<div class="layui-input-block">
							<input type="text" name="name" value="{$dinghuo.name}" required lay-verify="required" readonly class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">账号(手机号)</label>
						<div class="layui-input-block">
							<input type="text" name="mobile" value="{$dinghuo.mobile}" readonly class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">商品名称</label>
						<div class="layui-input-block">
							<input type="text" name="money" value="{$dinghuo.goods_name}" readonly class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">商品数量</label>
						<div class="layui-input-block">
							<input type="text" name="nums" value="{$dinghuo.nums}" readonly placeholder="请输入真实姓名" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">凭证</label>
						<div class="layui-input-block">
							<img style="height: 200px;width: 200px;" src="{$dinghuo.pz}" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">状态</label>
						<div class="layui-input-inline">
						      <select name="status"  class="layui-input">
								<option value="1" {if $dinghuo.status==1 }selected{/if}>待审核</option>
								<option value="2" {if $dinghuo.status==2 }selected{/if}>已发货</option>
								<option value="3" {if $dinghuo.status==3 }selected{/if}>已收货</option>
								<option value="4" {if $dinghuo.status==4 }selected{/if}>已关闭</option>
						      </select>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<input type="hidden" name="id" value="{$dinghuo.id}">
							<button class="layui-btn" onclick="set_dinghuo()"  lay-submit lay-filter="*">确认</button>
							<button type="reset" onclick="guanbi()" class="layui-btn layui-btn-primary">关闭</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
<script>
	// 定义全局JS变量
	var GV = {
		current_controller: "{$controller}/index"
	};
</script>
<script type="text/javascript" src="/public/static/js/jquery.min.js"></script>
<link rel="stylesheet" href="/public/static/layui/css/layui.css">
<script src="/public/static/layui/layui.all.js"></script>
<script>
	function set_dinghuo(){
		 $.ajax({
	     	type:"post",
	        url:"{:url('member/set_dinghuo')}",
	        data: $('#my_form').serialize(),
	        success:function(data){
	            layer.msg(data.msg, {
					  icon: 1,
					  time: 1500 
					}, function(){
						var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
						parent.layer.close(index);
						location.href = "{:url('member/pt_dinghuo')}";
				});
	        }
		});
	}
	
	//关闭
	function guanbi(){
		var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
		parent.layer.close(index);		
	}
</script>
